package com.example.controller.test;

import com.example.pojo.vo.common.Result;
import com.example.service.test.ErrorAspectTestService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author LiYuhang
 * @version 0.1
 * @application
 * @Date 2020/10/17 9:27
 */
@RestController
@RequestMapping(value = "/aspect")
@Slf4j
public class ErrorAspectTestController {

    @Autowired
    ErrorAspectTestService errorAspectTestService;
    @RequestMapping(value = "/error")
    public Result error(String name,String value) throws Exception {
        if (true) {
            throw new Exception("异常");
        }
        return Result.OK();
    }
    @RequestMapping(value = "/errorService")
    public void errorService()  {
        try {
            errorAspectTestService.makeAnErrot();
        } catch (Exception e) {

        }
    }

    @RequestMapping()
    public void logTest()  {
       log.info("xxxxxxxxxxxxx");
    }


}
